package com.zkthink.ceres.common.enums;

import com.zkthink.exception.BizException;
import lombok.Getter;

/**
 * @ClassName MidTypeEnumType
 * @Description: MidTypeEnumType
 * @Author ck
 * @Date 2021/12/17
 * @Version V1.0
 **/
@Getter
public enum MidTypeEnumType {
    ALL_MID("1", "全部客户"),
    BUFEN_MID("2", "根据客户号");

    private String code;

    private String desc;

    MidTypeEnumType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static MidTypeEnumType getDscByType(String type) {
        for (MidTypeEnumType p : values()) {
            if (p.getCode().equals(type)) {
                return p;
            }
        }
        throw new BizException("no support promotionPlan");
    }
}